package com.suge.home.module.screen.json;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.suge.order.dao.UserBizOrderDAO;
import com.suge.order.dao.dataobject.UserBizOrderDO;

public class QueryNoSendBuyer {

	@Autowired
    private HttpServletRequest request;
	@Autowired
	private UserBizOrderDAO userBizOrderDAO;
	public void execute(Context context, Navigator nav) {

		String userId = request.getParameter("userId");
		if(userId==null || userId==""){
			context.put("isSuccess", false);
			return;
		}
		long userIdNum =  Long.parseLong(userId);
		UserBizOrderDO userBizorderDO = userBizOrderDAO.getUserBizOrderByUserId(userIdNum);
		if(userBizorderDO==null){
			context.put("buyers", "");
		}
		else{
			String noSend = userBizorderDO.getNoSendUsers();
			if(noSend==null || noSend==""){
				context.put("buyers", "");
			}
			else{
				context.put("buyers", noSend);
			}
		}
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpServletRequest getRequest() {
		return request;
	}

	public void setUserBizOrderDAO(UserBizOrderDAO userBizOrderDAO) {
		this.userBizOrderDAO = userBizOrderDAO;
	}

	public UserBizOrderDAO getUserBizOrderDAO() {
		return userBizOrderDAO;
	}




}
